#!/bin/bash

#find ./ -path './ucos*' -a -prune -o -name *.S -print
#find ./ \( -path './ucos*' -o -path './lib*' \) -a -prune -o -name *.c

#for f in $(find . -name '*.c' -or -name '*.cpp' -or -name '*.h' -type f)
for f in $(find . \( -path './os*' -o -path './lib*' \) -a -prune -o -name '*.c' -print -o -name '*.h' -print)
do
	astyle --style=kr --indent-switches --pad-oper --pad-header --suffix=none $f > /dev/null
done

# Delete *.orig file.
#for f in $(find . -name '*.orig' -type f)
#do
#	rm $f
#done

